<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:75:"D:\fangcms\fangcms_city_add\public/../application/manage\view\city\add.html";i:1493720368;}*/ ?>
<!--添加栏目-->
<div class="dialog_content">
	<form id="info_form" action="<?php echo url('City/addDo'); ?>" method="post">
	<table width="100%" class="table_form">
		<tr> 
			<th width="120">上级栏目 :</th>
			<td>
				<select class="J_cate_select mr10" data-pid="0" data-uri="<?php echo url('City/ajaxGetchilds'); ?>" data-selected="<?php echo $spid; ?>"></select>
				<input type="hidden" name="pid" id="J_cate_id" />
			</td>
		</tr>
		<tr>
			<th>栏目名称 :</th>
			<td>
				<textarea name="name" id="name" style="width:210px;height:50px;resize:none;"></textarea>
		</tr>
		<tr>
			<th>栏目别名 :</th>
			<td>
				<input type="text" name="alias" id="alias" class="input-text" size="20">
				
                <label><input type="radio" name="aliasRadio" value="2" checked="checked"> 全部拼音</label>&nbsp;&nbsp;
				<label><input type="radio" name="aliasRadio" value="1"> 首字母拼音</label>
			</td>
		</tr>
		<?php if(empty($spid) || (($spid instanceof \think\Collection || $spid instanceof \think\Paginator ) && $spid->isEmpty())): ?>
		<tr>
			<th>绑定域名 :</th>
			<td>
				<input type="text" name="domain" id="domain" class="input-text" size="30">
			</td>
		</tr>
		<tr>
			<th>默认城市 :</th>
			<td>
				<label><input type="radio" name="default" value="1">是</label>&nbsp;&nbsp;
				<label><input type="radio" name="default" value="0" checked="checked">否</label>
				<p>用户首次进入网站会根据ip定位城市，若未找到对应城市则跳至默认城市,只能设置一个默认城市。</p>
			</td>
		</tr>
		<?php endif; ?>
        <tr>
		<th>状态 :</th>
            <td>
                <label><input type="radio" name="status" value="1" checked="checked"> 发布</label>&nbsp;&nbsp;
                <label><input type="radio" name="status" value="0"> 待审</label>
            </td>
        </tr>
		<tr>
			<th>SEO 标题 :</th>
			<td><input type="text" name="seo_title" id="seo_title" class="input-text" size="47"></td>
		</tr>
		<tr>
			<th>SEO 关键词 :</th>
			<td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="47"></td>
		</tr>
		<tr>
			<th>SEO 描述 :</th>
			<td><textarea name="seo_desc" style="width:300px; height:50px;"></textarea></td>
		</tr>
	</table>
	</form>
</div>
<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	$("#name").formValidator({onshow:'请填写名称',onfocus:'请填写名称'}).inputValidator({min:1,onerror:'请填写名称'});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
			$.yingloujie.tip({content:result.msg});
			setTimeout(function(){window.location.reload();},1000);
		} else {
			$.yingloujie.tip({content:result.msg, icon:'alert'});
		}
	}
	$('.J_cate_select').cate_select();
	

});
</script>